package earthalbumext;

public class FlickrAPI {
	private final static String API_KEY = "188156d91f52c365f7baf9a384330176";
	private final static String FORMAT = "rest";
	private final static String FLICKR_PHOTOS_SEARCH = "flickr.photos.search";
	private final static String FLICKR_PHOTOS_GETINFO = "flickr.photos.getInfo";
  private final static int IMAGE_PER_PAGE = 100;
	
	private final static String REQUEST_URL_PREFIX 
								= "http://api.flickr.com/services/rest/?";
	
	private FlickrAPI(){}
	
	public static String getFlickrPhotosSearchByLatLon(double lat, double lon){
		return REQUEST_URL_PREFIX +
				"method=" + FLICKR_PHOTOS_SEARCH +
				"&format=" + FORMAT +
				"&api_key=" + API_KEY +
				"&radius=30" +
				"&radius_units=km" +
				"&min_upload_date=0000000000" +
				"&per_page=" + IMAGE_PER_PAGE +
				"&lat=" + lat +
				"&lon=" + lon;
	}
	
	public static String getFlickrPhotosInfo(String photo_id, String secret){
		return REQUEST_URL_PREFIX + 
        "method=" + FLICKR_PHOTOS_GETINFO +
        "&format=" + FORMAT +
        "&api_key=" + API_KEY +
        "&photo_id=" + photo_id +
        "&secret=" + secret;
	}
}
